throw new MWException( __METHOD__ . ": invalid versionCallback for file" .
" \"{$fileInfo['name']}\" in module \"{$this->getName()}\"" );
}
- $expanded['definitionSummary'] = ( $fileInfo['versionCallback'] )( $context );
+ $expanded['definitionSummary'] =
+ ( $fileInfo['versionCallback'] )( $context, $this->getConfig() );
// Don't invoke 'callback' here as it may be expensive (T223260).
$expanded['callback'] = $fileInfo['callback'];
} else {
- $expanded['content'] = ( $fileInfo['callback'] )( $context );
+ $expanded['content'] = ( $fileInfo['callback'] )( $context, $this->getConfig() );
}
} elseif ( isset( $fileInfo['config'] ) ) {
if ( $type !== 'data' ) {
$fileInfo['content'] = $content;
unset( $fileInfo['filePath'] );
} elseif ( isset( $fileInfo['callback'] ) ) {
- $fileInfo['content'] = ( $fileInfo['callback'] )( $context );
+ $fileInfo['content'] = ( $fileInfo['callback'] )( $context, $this->getConfig() );
unset( $fileInfo['callback'] );
}
'remoteBasePath' => "$wgResourceBasePath/resources/src/mediawiki.jqueryMsg",
'packageFiles' => [
'mediawiki.jqueryMsg.js',
- [ 'name' => 'parserDefaults.json', 'callback' => function ( ResourceLoaderContext $context ) {
+ [ 'name' => 'parserDefaults.json', 'callback' => function (
+ ResourceLoaderContext $context, Config $config
+ ) {
$tagData = Sanitizer::getRecognizedTagData();
$allowedHtmlElements = array_merge(
array_keys( $tagData['htmlpairs'] ),
);
$magicWords = [
- 'SITENAME' => $context->getConfig()->get( 'Sitename' ),
+ 'SITENAME' => $config->get( 'Sitename' ),
];
Hooks::run( 'ResourceLoaderJqueryMsgModuleMagicWords', [ $context, &$magicWords ] );